<template>
	<view class="content bgGray">
		<view class="p16 flex-r ver-c jsb bgWhite li">
			<view>商户名称</view>
			<view class="gray">{{ info.tMerchantname }}</view>
		</view>
		<view class="p16 flex-r jsb bgWhite li">
			<view>商户地址</view>
			<view class="fs13 gray">{{ info.tMerchantaddress }}</view>
		</view>
		<view class="p16 flex-r jsb bgWhite li">
			<view>信用代码</view>
			<view class="gray" v-if="info.tMerchantcreditcode">{{ info.tMerchantcreditcode }}</view>
		</view>
		<view class="p16 flex-r jsb bgWhite li">
			<view>商户状态</view>
			<view class="gray">{{ info.tMerchantstatus == '1' ? '上线' : '下线' }}</view>
		</view>
		<view class="p16 flex-r jsb bgWhite li">
			<view>所在省份</view>
			<view class="gray">{{ info.proviceName }}</view>
		</view>
		<view class="p16 flex-r jsb bgWhite li">
			<view>所在城市</view>
			<view class="gray">{{ info.cityName }}</view>
		</view>
		<view class="savebtn textCenter white" @tap="check(info.tMerchantid, '2')">通过</view>
		<view class="savebtn2 textCenter" @tap="check(info.tMerchantid, '3')">驳回</view>
	</view>
</template>

<script>
import Utils from '@/utils/utils.js'
import { checkMerchant } from '@/api/mine.js'
export default {
	data() {
		return {
			info: {}
		}
	},
	onLoad(option) {
		this.info = JSON.parse(option.data)
		console.log(this.info)
	},
	methods: {
		check(tMerchantid, status) {
			let params = {
				tExaminestatus: status,
				tMerchantid: tMerchantid
			}
			checkMerchant(params).then(
				res => {
					console.log(res)
					if (res.code == 200) {
						uni.navigateBack({
							delta: 1,
							success: function() {
								setTimeout(() => {
									Utils.toast(res.msg)
								}, 300)
							}
						})
					} else {
						Utils.toast(res.msg)
					}
				},
				err => {
					console.log(err)
				}
			)
		}
	}
}
</script>

<style lang="stylus" scoped>
.content
	min-height 100%
.li
	border-bottom 1rpx solid #eee
.savebtn
	margin 60rpx 32rpx 0
	border-radius 50rpx
	background #c40414
	line-height 80rpx
.savebtn2
	margin 32rpx 32rpx
	border-radius 50rpx
	border 1rpx solid #c40414
	color #c40414
	line-height 80rpx
</style>
